﻿@model List<Lion.WeiXin.Core.Models.Order_DetailsModel>
@{
    Layout = "~/Views/Shared/_AppLayout.cshtml";
    Lion.WeiXin.Core.Models.VipCardModel curVip = ViewData[Lion.WeiXin.Core.Models.KeysEnum.VipCard.ToString()] as Lion.WeiXin.Core.Models.VipCardModel;   
}
@section ChildPageJs {
    <link rel="stylesheet" href="/Content/Mobile/plugin/mobiscroll.custom-2.6.2.min.css" />
    <script src="/Content/Mobile/plugin/mobiscroll.custom-2.6.2.min.js" type="text/javascript"></script>
    <script src="/Scripts/WeChat/WeChatProductShoppingCart.js" type="text/javascript"></script>

}
<style>
    .mh-title {
        margin-top: 0px;
        text-align: center;
        word-wrap: normal;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
        background-color: #0e90d2;
        color: white;
        height: 40px;
        line-height: 40px;
    }

    .mh-content {
        padding: 1px 5px 1px 5px;
        margin: 0px 5px 0px 5px;
        color: #0e90d2;
    }
    /*去掉listview 中的图标*/
    .ui-listview .ui-icon-arrow-r {
        background: transparent url(images/arrow_right.png) center center no-repeat !important;
        -webkit-border-radius: 0;
        -moz-border-radius: 0;
        border-radius: 0;
    }

    .boxBtn {
        display: block;
        background-color: #fa5151;
        height: 100%;
        z-index: 100;
        width: 40%;
        position: relative;
        border: 1px solid;
    }

    p {
        font-size: .75em;
        font-weight: normal;
        display: block;
        margin: .6em 0;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
    }

    h3, h4, h5 {
        font-size: 1em;
        font-weight: bold;
        display: block;
        margin: .45em 0;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
    }
</style>
<div id="divOrder">
    <ul id="cardInfo" data-role="listview" data-inset="true">
        <li data-theme="b" data-role="list-divider">
            <h3>我的会员卡</h3>
        </li>
        @if (curVip != null)
        {           
            <li>
                <p>尊敬的：@ViewData[Lion.WeiXin.Core.Models.KeysEnum.NickName.ToString()].ToString()</p>
                <p>卡号：@curVip.Code</p>
                <p>卡余：@curVip.Balance 元</p>
                <p>卡折扣：@curVip.Discount 折</p>
                <span class="ui-li-count">累积消费：￥@curVip.Total.ToString("#0.00")</span>
            </li>
        }
        else
        {
            <li>
                <p style="color: red;">尊敬的：@ViewData[Lion.WeiXin.Core.Models.KeysEnum.NickName.ToString()].ToString(),您还没绑定会员卡</p>
            </li>
        }
    </ul>

    <form id="fmSave" class="am-form">


        <ul id="olOrder" data-role="listview" data-inset="true">
            <li id="liHeader" data-theme="b" data-role="list-divider">
                <h3>我的购物车</h3>
            </li>
            @if (Model.Count == 0)
            { 
                <li id="liTemp" data-icon="arror-r" data-shadow="false">
                    <h2>购物车是空的</h2>
                </li>
            }
            else
            {

                foreach (Lion.WeiXin.Core.Models.Order_DetailsModel item in Model)
                {
                    
                <li id="liData" data-shadow="false" data-icon="false">
                    <a>
                        <img src="@item.Image" style="width:100%;height:100%;" />
                        <input type="hidden" id="Pro_ID" name="Pro_ID" value="@item.Pro_ID"/>
                        <p style="margin: 0px; font-weight: bold">@item.ProductName </p>
                        <p>价格：￥ <span id="pPrice" style="color: red">@item.BuyPrice.ToString("#0.00")</span> </p>
                        <p>
                            <input id="btnMinus" name="btnMinus" type="button" data-role="none" value="-" />
                            <input type="text" data-role="none" style="width:21px;"  name="Quantity" id="Quantity" value="@item.Quantity"  readonly="true" />
                            <input id="btnPlus" name="btnPlus" type="button" data-role="none" value="+" />
                        </p>
                        <p style="margin: 0px;">小计：￥ <span id="total">@((item.BuyPrice * item.Quantity).ToString("#0.00"))</span></p>
                    </a>
                    <a data-icon="delete">删除</a>
                </li> 
                
                }
            }
            <li id="lifooter" data-theme="a" data-role="list-divider">
                <h2>总计：￥ <span id="OrderTotal" style="color: red">@ViewData[Lion.WeiXin.Core.Models.KeysEnum.Total.ToString()].ToString()</span> 元
                </h2>
            </li>
        </ul>

        <hr />
        @if (curVip != null)
        {            
            <div data-role="fieldcontain" data-mini="true">
                <input type="hidden" id="Buyer" value="@curVip.Code" />
                <label id="pwd" for="Password">*密码：</label>
                <input type="password" id="Password" name="Password" value="@curVip.Password" placeholder="输入卡号密码" />
            </div>
            <div data-role="fieldcontain">
                <label for="Buyer_Phone">*电话：</label>
                <input type="text" id="Buyer_Phone" name="Buyer_Phone" value="@curVip.Phone" placeholder="输入电话" />
            </div>
            <div data-role="fieldcontain">
                <label for="appointment">*时间：</label>
                <input type="text" id="Buyer_appointment" data-role="datebox" name="Buyer_appointment" placeholder="预约时间" />
            </div>
            <div data-role="fieldcontain">
                <label for="Buyer_Note">地址：</label>
                <textarea name="Buyer_Note" id="Buyer_Note" placeholder="接送地址"></textarea>
            </div>
            <div data-role="fieldcontain">
                <input type="button" id="btnSave" data-corners="false" data-icon="check" iconpos="left" value="支 付" />
            </div>
        }
        else
        {
            <!--非会员用户跳转绑定会员卡-->
            <div data-role="fieldcontain">
                <h2 style="color: red">很抱歉，您的微信号尚未绑定会员卡不能完成支付</h2>
                <p><a href="/WeChatProduct/BindVipCard" rel="external" data-role="button" data-corners="false">立即绑定</a></p>
            </div>
        }
    </form>
</div>
<div id="divOk" style="display: none; text-align: center;width:100%;height:90%" data-role="fieldcontain" class="content">
    <img style="width: 100px; height: 100px" src="/Content/Mobile/check.jpg" />
    <h3>恭喜,支付成功！</h3>
    <p>稍后，我们的工作人员将与您联系，并为您提供服务</p>
    <p><a href="/WeChatProduct/MyOrder" data-role="button">查看我的订单</a></p>
</div>



